<?php
$i = count($data);
while($i > 0){
    $i--;
    $d = $data[$i];
    $msg = $d['ChatsMessage']['content'];
?>
    <div class="chatMessage">
        <input type="hidden" class="idChatMessage" value="<?php echo $d['ChatsMessage']['id'];?>"/>
        <div class="">
            <div class="col6 left">
                <div class="user">
                <?php echo $this->Display->link($d['User'], 'User');?> 
                </div>
            </div>
            <div class="col3 right">
                <div class="date">
                    <span class="date"><?php echo $this->Date->getDisplay($d['ChatsMessage']['posted_on']);?></span>
                </div>
            </div>
        </div>
        <div class="clear content">
                <p>
                    <?php echo $msg;?>
                </p>
        </div>
    </div>
<?php
}

?>